package tests;

import java.util.Arrays;
import java.util.Scanner;

//mkdir
public class test22 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNextInt()){
            int n = sc.nextInt();
            String[] path = new String[n];
            for(int i = 0;i < n;i++){
                path[i] = sc.next();
            }

            Arrays.sort(path);
            //伪删除法：标记
            //过滤相同目录||子目录
            boolean[] flag = new boolean[n];
            for(int i = 0;i < n-1;i++){
                if(path[i].equals(path[i+1])){
                    flag[i] = true;
                }else if(path[i].length()<path[i+1].length() && path[i+1].contains(path[i])
                        && path[i+1].charAt(path[i].length())=='/'){
                    flag[i] = true;
                }
            }
            //拼接输出的结果
            for(int i = 0;i < n;i++){
                if(!flag[i]){
                    System.out.println("mkdir -p "+path[i]);
                }
            }
            System.out.println();

        }
    }
}
